from django.db import models

# Create your models here.


class ContentModel(models.Model):
    """
    接收富文本编辑器的内容
    """
    content = models.TextField()

    def __str__(self):
        return self.content


class Movie(models.Model):
    """
    电影
    """
    name = models.CharField(max_length=60)
    img = models.ImageField(upload_to='img')
    release_date = models.DateField()

    def __str__(self):
        return self.name


class Actor(models.Model):
    """
    演员
    """
    name = models.CharField(max_length=30)
    age = models.IntegerField()
    sex = models.CharField(max_length=8)
    movie = models.ManyToManyField(Movie)

    def __str__(self):
        return self.name












